 @layout("/common/_container.html",{plugins:["ztree"]}){

<div class="layui-body-header">
    <span class="layui-body-header-title">通知管理</span>
</div>
<style>

</style>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-lg12">
            <input id = "empId" value="${empId}" type="hidden">
            <input id = "attendYearMonth" value="${attendYearMonth}" type="hidden">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form toolbar">
<!--                        <p class="layui-form-label">缺卡时间：</p>-->
                        <div>
                            缺卡时间：
                            <ol id = "attend" type="1"></ol>
                        </div>

                        <hr style="background-color: #0C0C0C;">
                        <div>
                            迟到时间：
                            <ol id = "lateNum" type="1"></ol>
                        </div>

                        <hr style="background-color: #0C0C0C;">
                        <div>
                            外出申请：
                            <ol id = "requestOut" type="1"></ol>
                        </div>

                        <hr style="background-color: #0C0C0C;">
                        <div>
                            请假：
                            <ol id = "askLeave" type="1"></ol>
                        </div>

                        <hr style="background-color: #0C0C0C;">
                        打卡修改状态：
                        <ol id = "attendUpdateNote" type="1"></ol>
                    </div>
                    <table class="layui-table" id="noticeTable" lay-filter="noticeTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="tableBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" style="display: block" lay-event="delete">删除</a>
</script>
@}
<script src="/assets/modular/system/jq/jquery-ui.min.js"></script>
<script>
    $(function (){
        var empId = $("#empId").val();
        var attendYearMonth = $("#attendYearMonth").val();
        $.ajax({
            type: "POST",
            url: "/btyDingdingMonthAttend/detailList?empId=" + empId + "&attendYearMonth=" + attendYearMonth ,
            async: false,
            contentType: 'application/json',
            success: function (data) {

              //请假数据
              for (i = 0 ; i < data.data.askLeaveList.length; i ++){
                  var a = i+1;
                  $("#askLeave").append( "<li>" + a + "、" + data.data.askLeaveList[i].requestNote + "</li>");
              }

              //外出申请数据
              for (i = 0 ; i < data.data.requestOutList.length; i ++){
                    var a = i+1;
                    $("#requestOut").append( "<li>" + a + "、" + data.data.requestOutList[i].requestNote + "</li>");
              }



                 //缺卡数据
                for (i = 0 ; i < data.data.attendList.length; i ++){
                    var a = i+1;
                    var attendDay = data.data.attendList[i].attendDay.substring(0,10);//日期
                    var timeOne = data.data.attendList[i].timeOne == "" ? "空": data.data.attendList[i].timeOne.substring(10, 16);//第一次打卡时间
                    var timeTwo = data.data.attendList[i].timeTwo == "" ? "空" : data.data.attendList[i].timeTwo.substring(10, 16);//第二次打卡时间
                    var timeThree = data.data.attendList[i].timeThree == "" ? "空" : data.data.attendList[i].timeThree.substring(10, 16);//第三次打卡时间
                    var timeFour = data.data.attendList[i].timeFour == "" ? "空" : data.data.attendList[i].timeFour.substring(10, 16);//第四次打卡时间

                    $("#attend").append( "<li>" + a + "、" + attendDay + "【" + timeOne + ", " + timeTwo + ", " + timeThree + ", " + timeFour + "】" + "</li>");
                }

                //迟到数据
                for (i = 0 ; i < data.data.lateNumList.length; i ++){
                    var a = i+1;
                    var attendDay = data.data.lateNumList[i].attendDay.substring(0,10);//日期
                    var timeOne = data.data.lateNumList[i].timeOne == "" ? "空": data.data.lateNumList[i].timeOne.substring(10, 16);//第一次打卡时间
                    var timeTwo = data.data.lateNumList[i].timeTwo == "" ? "空" : data.data.lateNumList[i].timeTwo.substring(10, 16);//第二次打卡时间
                    var timeThree = data.data.lateNumList[i].timeThree == "" ? "空" : data.data.lateNumList[i].timeThree.substring(10, 16);//第三次打卡时间
                    var timeFour = data.data.lateNumList[i].timeFour == "" ? "空" : data.data.lateNumList[i].timeFour.substring(10, 16);//第四次打卡时间

                    $("#lateNum").append( "<li>" + a + "、" + attendDay + "【" + timeOne + ", " + timeTwo + ", " + timeThree + ", " + timeFour + "】" +"班次:" + data.data.lateNumList[i].attendShiftNote+ "</li>");
                }

                //修改数据备注
                for (i = 0 ; i < data.data.attendUpdateNoteList.length; i ++){
                    var a = i+1;
                    var attendDay = data.data.attendUpdateNoteList[i].attendDay.substring(0,10);//日期
                    var timeOneNote = data.data.attendUpdateNoteList[i].timeOneNote == "" ? "空": data.data.attendUpdateNoteList[i].timeOneNote;//第一次打卡备注
                    var timeTwoNote = data.data.attendUpdateNoteList[i].timeTwoNote == "" ? "空" : data.data.attendUpdateNoteList[i].timeTwoNote;//第二次打卡备注
                    var timeThreeNote = data.data.attendUpdateNoteList[i].timeThreeNote == "" ? "空" : data.data.attendUpdateNoteList[i].timeThreeNote;//第三次打卡备注
                    var timeFourNote = data.data.attendUpdateNoteList[i].timeFourNote == "" ? "空" : data.data.attendUpdateNoteList[i].timeFourNote;//第四次打卡备注

                    $("#attendUpdateNote").append( "<li>" + a + "、" + attendDay + "【" + timeOneNote + ", " + timeTwoNote + ", " + timeThreeNote + ", " + timeFourNote + "】" + "</li>");
                }


            },
        });
    })

</script>